var api = require('../../utils/api');
var utils = require('../../utils/utils');
Page({
    data: {
        allShow: false,
    },
    onLoad: function () {
        this.loadBalance();
    },
    loadBalance: function () {
        api.getUserInfo().then(balanceData => {
            this.setData({
                balanceData: utils.formatBalance(balanceData)
            });
        });
    },
    switchAll: function () {
        this.setData({
            allShow: !this.data.allShow
        })
    },
    copy: function (e) {
        var value = e.currentTarget.dataset.value;
        wx.setClipboardData({
            data: String(value),
            success: () => {
                wx.showToast({
                    title: '复制成功'
                });
            }
        })
    }
})